﻿using System;
using System.Globalization;
using System.Resources;
using System.Reflection;

/// <summary>
/// Reflected from: Microsoft.TeamFoundation.Build.Workflow.WorkflowResources.
/// Assembly: Microsoft.TeamFoundation.Build.Workflow, Version=10.0.0.0.
/// </summary>
internal static class WorkflowResources
{
    // Fields
    public const string ActivityCannotBeInAgentScope = "ActivityCannotBeInAgentScope";
    public const string ActivityHostEnvironmentIsInvalid = "ActivityHostEnvironmentIsInvalid";
    public const string ActivityMustBeInAgentScope = "ActivityMustBeInAgentScope";
    public const string ActivityShouldBeDynamicActivity = "ActivityShouldBeDynamicActivity";
    public const string AgentExecutionTimeoutException = "AgentExecutionTimeoutException";
    public const string AgentReservationSpecFormat = "AgentReservationSpecFormat";
    public const string AgentReservationTimeoutException = "AgentReservationTimeoutException";
    public const string BuildProcessRootActivityDisplayName = "BuildProcessRootActivityDisplayName";
    public const string BuildProcessSerializationException = "BuildProcessSerializationException";
    public const string BuildStoppingException = "BuildStoppingException";
    public const string ConstraintViolationError = "ConstraintViolationError";
    public const string ConstraintViolationWarning = "ConstraintViolationWarning";
    public const string LabProcessSettingsDescription = "LabProcessSettingsDescription";
    public const string LabProcessSettingsDisplayName = "LabProcessSettingsDisplayName";
    public const string ProcessParameterAdvancedCategory = "ProcessParameterAdvancedCategory";
    public const string ProcessParameterBasicCategory = "ProcessParameterBasicCategory";
    public const string ProcessParameterCompatibilityCategory = "ProcessParameterCompatibilityCategory";
    public const string ProcessParameterDefaultCategory = "ProcessParameterDefaultCategory";
    public const string ProcessParameterRequiredCategory = "ProcessParameterRequiredCategory";
    public const string ProjectFileNotFoundException = "ProjectFileNotFoundException";
    public const string ReservationSpecEmptyName = "ReservationSpecEmptyName";
    private static ResourceManager s_resMgr = new ResourceManager("WorkflowResources", Assembly.GetAssembly(typeof(WorkflowResources)));
    public const string ServiceMissingException = "ServiceMissingException";
    public const string SourceAndSymbolServerSettingsDescription = "SourceAndSymbolServerSettingsDescription";
    public const string SourceAndSymbolServerSettingsDisplayName = "SourceAndSymbolServerSettingsDisplayName";
    public const string StartTeamBuildSequentialWorkflow = "StartTeamBuildSequentialWorkflow";
    public const string StringListItemFormat = "StringListItemFormat";
    public const string TeamBuildWorkflowAgentMaxExecutionTimeDescription = "TeamBuildWorkflowAgentMaxExecutionTimeDescription";
    public const string TeamBuildWorkflowAgentMaxExecutionTimeDisplayName = "TeamBuildWorkflowAgentMaxExecutionTimeDisplayName";
    public const string TeamBuildWorkflowAgentMaxWaitTimeDescription = "TeamBuildWorkflowAgentMaxWaitTimeDescription";
    public const string TeamBuildWorkflowAgentMaxWaitTimeDisplayName = "TeamBuildWorkflowAgentMaxWaitTimeDisplayName";
    public const string TeamBuildWorkflowAgentSettingsDescription = "TeamBuildWorkflowAgentSettingsDescription";
    public const string TeamBuildWorkflowAgentSettingsDisplayName = "TeamBuildWorkflowAgentSettingsDisplayName";
    public const string TeamBuildWorkflowAssociateChangesetsAndWorkItemsDescription = "TeamBuildWorkflowAssociateChangesetsAndWorkItemsDescription";
    public const string TeamBuildWorkflowAssociateChangesetsAndWorkItemsDisplayName = "TeamBuildWorkflowAssociateChangesetsAndWorkItemsDisplayName";
    public const string TeamBuildWorkflowBinariesSubdirectoryDescription = "TeamBuildWorkflowBinariesSubdirectoryDescription";
    public const string TeamBuildWorkflowBinariesSubdirectoryDisplayName = "TeamBuildWorkflowBinariesSubdirectoryDisplayName";
    public const string TeamBuildWorkflowBuildDetailDescription = "TeamBuildWorkflowBuildDetailDescription";
    public const string TeamBuildWorkflowBuildNumberFormatDescription = "TeamBuildWorkflowBuildNumberFormatDescription";
    public const string TeamBuildWorkflowBuildNumberFormatDisplayName = "TeamBuildWorkflowBuildNumberFormatDisplayName";
    public const string TeamBuildWorkflowBuildSettingsDescription = "TeamBuildWorkflowBuildSettingsDescription";
    public const string TeamBuildWorkflowBuildSettingsDisplayName = "TeamBuildWorkflowBuildSettingsDisplayName";
    public const string TeamBuildWorkflowCleanWorkspaceDescription = "TeamBuildWorkflowCleanWorkspaceDescription";
    public const string TeamBuildWorkflowCleanWorkspaceDisplayName = "TeamBuildWorkflowCleanWorkspaceDisplayName";
    public const string TeamBuildWorkflowCommandLineArgumentsDescription = "TeamBuildWorkflowCommandLineArgumentsDescription";
    public const string TeamBuildWorkflowCommandLineArgumentsDisplayName = "TeamBuildWorkflowCommandLineArgumentsDisplayName";
    public const string TeamBuildWorkflowConfigurationFolderPathDescription = "TeamBuildWorkflowConfigurationFolderPathDescription";
    public const string TeamBuildWorkflowConfigurationFolderPathDisplayName = "TeamBuildWorkflowConfigurationFolderPathDisplayName";
    public const string TeamBuildWorkflowCreateLabelDescription = "TeamBuildWorkflowCreateLabelDescription";
    public const string TeamBuildWorkflowCreateLabelDisplayName = "TeamBuildWorkflowCreateLabelDisplayName";
    public const string TeamBuildWorkflowCreateWorkItemDescription = "TeamBuildWorkflowCreateWorkItemDescription";
    public const string TeamBuildWorkflowCreateWorkItemDisplayName = "TeamBuildWorkflowCreateWorkItemDisplayName";
    public const string TeamBuildWorkflowDisableTestsDescription = "TeamBuildWorkflowDisableTestsDescription";
    public const string TeamBuildWorkflowDisableTestsDisplayName = "TeamBuildWorkflowDisableTestsDisplayName";
    public const string TeamBuildWorkflowDoNotDownloadBuildTypeDescription = "TeamBuildWorkflowDoNotDownloadBuildTypeDescription";
    public const string TeamBuildWorkflowDoNotDownloadBuildTypeDisplayName = "TeamBuildWorkflowDoNotDownloadBuildTypeDisplayName";
    public const string TeamBuildWorkflowDropBuildDescription = "TeamBuildWorkflowDropBuildDescription";
    public const string TeamBuildWorkflowDropBuildDisplayName = "TeamBuildWorkflowDropBuildDisplayName";
    public const string TeamBuildWorkflowGetVersionDescription = "TeamBuildWorkflowGetVersionDescription";
    public const string TeamBuildWorkflowGetVersionDisplayName = "TeamBuildWorkflowGetVersionDisplayName";
    public const string TeamBuildWorkflowLogFilePerProjectDescription = "TeamBuildWorkflowLogFilePerProjectDescription";
    public const string TeamBuildWorkflowLogFilePerProjectDisplayName = "TeamBuildWorkflowLogFilePerProjectDisplayName";
    public const string TeamBuildWorkflowMSBuildArgumentsDescription = "TeamBuildWorkflowMSBuildArgumentsDescription";
    public const string TeamBuildWorkflowMSBuildArgumentsDisplayName = "TeamBuildWorkflowMSBuildArgumentsDisplayName";
    public const string TeamBuildWorkflowMSBuildPlatformDescription = "TeamBuildWorkflowMSBuildPlatformDescription";
    public const string TeamBuildWorkflowMSBuildPlatformDisplayName = "TeamBuildWorkflowMSBuildPlatformDisplayName";
    public const string TeamBuildWorkflowPerformTestImpactAnalysisDescription = "TeamBuildWorkflowPerformTestImpactAnalysisDescription";
    public const string TeamBuildWorkflowPerformTestImpactAnalysisDisplayName = "TeamBuildWorkflowPerformTestImpactAnalysisDisplayName";
    public const string TeamBuildWorkflowPrivateDropLocationDescription = "TeamBuildWorkflowPrivateDropLocationDescription";
    public const string TeamBuildWorkflowPrivateDropLocationDisplayName = "TeamBuildWorkflowPrivateDropLocationDisplayName";
    public const string TeamBuildWorkflowRecursionTypeDescription = "TeamBuildWorkflowRecursionTypeDescription";
    public const string TeamBuildWorkflowRecursionTypeDisplayName = "TeamBuildWorkflowRecursionTypeDisplayName";
    public const string TeamBuildWorkflowRunCodeAnalysisDescription = "TeamBuildWorkflowRunCodeAnalysisDescription";
    public const string TeamBuildWorkflowRunCodeAnalysisDisplayName = "TeamBuildWorkflowRunCodeAnalysisDisplayName";
    public const string TeamBuildWorkflowSourcesSubdirectoryDescription = "TeamBuildWorkflowSourcesSubdirectoryDescription";
    public const string TeamBuildWorkflowSourcesSubdirectoryDisplayName = "TeamBuildWorkflowSourcesSubdirectoryDisplayName";
    public const string TeamBuildWorkflowTestResultsSubdirectoryDescription = "TeamBuildWorkflowTestResultsSubdirectoryDescription";
    public const string TeamBuildWorkflowTestResultsSubdirectoryDisplayName = "TeamBuildWorkflowTestResultsSubdirectoryDisplayName";
    public const string TeamBuildWorkflowTestSpecsDescription = "TeamBuildWorkflowTestSpecsDescription";
    public const string TeamBuildWorkflowTestSpecsDisplayName = "TeamBuildWorkflowTestSpecsDisplayName";
    public const string TeamBuildWorkflowVerbosityDescription = "TeamBuildWorkflowVerbosityDescription";
    public const string TeamBuildWorkflowVerbosityDisplayName = "TeamBuildWorkflowVerbosityDisplayName";
    public const string ToolboxCategory_Build = "ToolboxCategory_Build";
    public const string ToolboxCategory_Lab = "ToolboxCategory_Lab";
    public const string ValidationFailedException = "ValidationFailedException";
    public const string WorkflowParameterRequired = "WorkflowParameterRequired";

    // Methods
    public static string Format(string resourceName, params object[] args)
    {
        string format = Get(resourceName);
        if (args == null)
        {
            return format;
        }
        for (int i = 0; i < args.Length; i++)
        {
            if (args[i] is DateTime)
            {
                DateTime time = (DateTime)args[i];
                Calendar calendar = DateTimeFormatInfo.CurrentInfo.Calendar;
                if (time > calendar.MaxSupportedDateTime)
                {
                    args[i] = calendar.MaxSupportedDateTime;
                }
                else if (time < calendar.MinSupportedDateTime)
                {
                    args[i] = calendar.MinSupportedDateTime;
                }
            }
        }
        return string.Format(CultureInfo.CurrentCulture, format, args);
    }

    public static string Get(string resourceName)
    {
        return s_resMgr.GetString(resourceName, CultureInfo.CurrentUICulture);
    }

    public static bool GetBool(string resourceName)
    {
        return (bool)s_resMgr.GetObject(resourceName, CultureInfo.CurrentUICulture);
    }

    public static int GetInt(string resourceName)
    {
        return (int)s_resMgr.GetObject(resourceName, CultureInfo.CurrentUICulture);
    }

    // Properties
    public static ResourceManager Manager
    {
        get
        {
            return s_resMgr;
        }
    }
}
